package com.jiazhong.commons.Mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.jiazhong.commons.bean.ShoppingCart;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Update;

@Mapper
public interface ShoppingCartMapper extends BaseMapper<ShoppingCart> {

    @Delete("delete from shopping_cart where user_id=#{userId} and book_id=#{bookId}")
    int deleteByBookId(ShoppingCart cart);
    @Update("update shopping_cart set number=#{number} where book_id=#{bookId} and user_id=#{userId}")
    int updateNumberByBookIdAndUserId(ShoppingCart cart);
}
